import React, { Component } from 'react'
import { connect } from 'react-redux'

class LoadingMedia extends Component {
  render() {
    const { show } = this.props
    return (
      <div className="loading_media" style={{display: show ? 'block' : 'none'}}>
        <img className="loading_media_image" src={require('@images/default_loading.gif')} alt=""/>
      </div>
    )
  }
}

const mapState = (state) => {
  return {
    show: state.ReplayState.showType.mediaLoading
  }
}

export default connect(mapState)(LoadingMedia)
